<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<meta name="theme-color" content="#222"><meta name="generator" content="Hexo 6.3.0">

  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">



<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.0/css/all.min.css" integrity="sha256-AbA177XfpSnFEvgpYu1jMygiLabzPCJCRIBtR5jGc0k=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.1.1/animate.min.css" integrity="sha256-PR7ttpcvz8qrF57fur/yAx1qXMFJeJFiA6pSzWi0OIE=" crossorigin="anonymous">

<script class="next-config" data-name="main" type="application/json">{"hostname":"fengxun2017.github.io","root":"/","images":"/images","scheme":"Muse","darkmode":false,"version":"8.13.2","exturl":false,"sidebar":{"position":"right","display":"hide","padding":18,"offset":12},"copycode":{"enable":false,"style":null},"bookmark":{"enable":false,"color":"#222","save":"auto"},"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"stickytabs":false,"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"fadeInDown","post_body":"fadeInDown","coll_header":"fadeInLeft","sidebar":"fadeInUp"}},"prism":false,"i18n":{"placeholder":"搜索...","empty":"没有找到任何搜索结果：${query}","hits_time":"找到 ${hits} 个搜索结果（用时 ${time} 毫秒）","hits":"找到 ${hits} 个搜索结果"}}</script><script src="/js/config.js"></script>

    <meta name="description" content="GNU binary utilities (GNU Binutils) version 2.42: —— c++filt">
<meta property="og:type" content="article">
<meta property="og:title" content="GNU binary utilities —— c++filt">
<meta property="og:url" content="http://fengxun2017.github.io/2024/11/27/GUN-binary-utilities-c++filt/index.html">
<meta property="og:site_name" content="fx">
<meta property="og:description" content="GNU binary utilities (GNU Binutils) version 2.42: —— c++filt">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2024-11-26T16:00:00.000Z">
<meta property="article:modified_time" content="2024-11-27T15:15:34.962Z">
<meta property="article:author" content="feng xun">
<meta name="twitter:card" content="summary">


<link rel="canonical" href="http://fengxun2017.github.io/2024/11/27/GUN-binary-utilities-c++filt/">



<script class="next-config" data-name="page" type="application/json">{"sidebar":"","isHome":false,"isPost":true,"lang":"zh-CN","comments":true,"permalink":"http://fengxun2017.github.io/2024/11/27/GUN-binary-utilities-c++filt/","path":"2024/11/27/GUN-binary-utilities-c++filt/","title":"GNU binary utilities —— c++filt"}</script>

<script class="next-config" data-name="calendar" type="application/json">""</script>
<title>GNU binary utilities —— c++filt | fx</title>
  






  <script async defer data-website-id="" src=""></script>

  <script defer data-domain="" src=""></script>

  <noscript>
    <link rel="stylesheet" href="/css/noscript.css">
  </noscript>
  <a target="_blank" rel="noopener" href="https://github.com/fengxun2017" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#70B7FD; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style>
</head>

<body itemscope itemtype="http://schema.org/WebPage" class="use-motion">
  <div class="headband"></div>

  <main class="main">
    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏" role="button">
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <i class="logo-line"></i>
      <p class="site-title">fx</p>
      <i class="logo-line"></i>
    </a>
      <p class="site-subtitle" itemprop="description">FreeRTOS交流QQ群-663806972 BLE学习交流群-498676838</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
    </div>
  </div>
</div>



<nav class="site-nav">
  <ul class="main-menu menu"><li class="menu-item menu-item-home"><a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a></li><li class="menu-item menu-item-categories"><a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a></li>
  </ul>
</nav>




</div>
        
  
  <div class="toggle sidebar-toggle" role="button">
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
  </div>

  <aside class="sidebar">

    <div class="sidebar-inner sidebar-nav-active sidebar-toc-active">
      <ul class="sidebar-nav">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <div class="sidebar-panel-container">
        <!--noindex-->
        <div class="post-toc-wrap sidebar-panel">
            <div class="post-toc animated"><ol class="nav"><li class="nav-item nav-level-5"><a class="nav-link" href="#x2F-%E2%80%93strip-underscore"><span class="nav-number">1.</span> <span class="nav-text">-_ &#x2F; –strip-underscore</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#n-x2F-%E2%80%93no-strip-underscore"><span class="nav-number">2.</span> <span class="nav-text">-n &#x2F; –no-strip-underscore</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#p-%E2%80%93no-params"><span class="nav-number">3.</span> <span class="nav-text">-p –no-params</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#t-%E2%80%93types"><span class="nav-number">4.</span> <span class="nav-text">-t –types</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#i-%E2%80%93no-verbose"><span class="nav-number">5.</span> <span class="nav-text">-i –no-verbose</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#r-x2F-R-x2F-%E2%80%93recurse-limit-x2F-%E2%80%93no-recurse-limit-x2F-%E2%80%93recursion-limit-x2F-%E2%80%93no-recursion-limit"><span class="nav-number">6.</span> <span class="nav-text">-r &#x2F; -R &#x2F; –recurse-limit &#x2F; –no-recurse-limit &#x2F; –recursion-limit &#x2F; –no-recursion-limit</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#s-format-x2F-%E2%80%93format-x3D-format"><span class="nav-number">7.</span> <span class="nav-text">-s format &#x2F; –format&#x3D;format</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#%E2%80%93help"><span class="nav-number">8.</span> <span class="nav-text">–help</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#%E2%80%93version"><span class="nav-number">9.</span> <span class="nav-text">–version</span></a></li></ol></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E5%8F%82%E8%80%83%E8%BF%9E%E6%8E%A5%EF%BC%9A"><span class="nav-number"></span> <span class="nav-text">参考连接：</span></a></div>
        </div>
        <!--/noindex-->

        <div class="site-overview-wrap sidebar-panel">
          <div class="site-author site-overview-item animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">feng xun</p>
  <div class="site-description" itemprop="description">FreeRTOS交流QQ群-663806972 BLE学习交流群-498676838</div>
</div>
<div class="site-state-wrap site-overview-item animated">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
        <a href="/archives/">
          <span class="site-state-item-count">96</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
          <a href="/categories/">
        <span class="site-state-item-count">16</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
  </nav>
</div>
  <div class="cc-license site-overview-item animated" itemprop="license">
    <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh" class="cc-opacity" rel="noopener" target="_blank"><img src="https://cdnjs.cloudflare.com/ajax/libs/creativecommons-vocabulary/2020.11.3/assets/license_badges/small/by_nc_sa.svg" alt="Creative Commons"></a>
  </div>



        </div>
      </div>
    </div>
  </aside>
  <div class="sidebar-dimmer"></div>


    </header>

    
  <div class="back-to-top" role="button" aria-label="返回顶部">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>

<noscript>
  <div class="noscript-warning">Theme NexT works best with JavaScript enabled</div>
</noscript>


    <div class="main-inner post posts-expand">


  


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://fengxun2017.github.io/2024/11/27/GUN-binary-utilities-c++filt/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="feng xun">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="fx">
      <meta itemprop="description" content="FreeRTOS交流QQ群-663806972 BLE学习交流群-498676838">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="GNU binary utilities —— c++filt | fx">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          GNU binary utilities —— c++filt
        </h1>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2024-11-27 00:00:00" itemprop="dateCreated datePublished" datetime="2024-11-27T00:00:00+08:00">2024-11-27</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/GNU-binary-utilities/" itemprop="url" rel="index"><span itemprop="name">GNU-binary-utilities</span></a>
        </span>
    </span>

  
    <span class="post-meta-break"></span>
    <span class="post-meta-item" title="本文字数">
      <span class="post-meta-item-icon">
        <i class="far fa-file-word"></i>
      </span>
      <span class="post-meta-item-text">本文字数：</span>
      <span>2.1k</span>
    </span>
    <span class="post-meta-item" title="阅读时长">
      <span class="post-meta-item-icon">
        <i class="far fa-clock"></i>
      </span>
      <span class="post-meta-item-text">阅读时长 &asymp;</span>
      <span>3 分钟</span>
    </span>
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
        <center>
GNU binary utilities (GNU Binutils) version 2.42: —— c++filt
</center>

<span id="more"></span>

<hr>
<p><strong>个人笔记，仅供参考！！</strong><br>c++filt [-_|–strip-underscore]<br>        [-n|–no-strip-underscore]<br>        [-p|–no-params]<br>        [-t|–types]<br>        [-i|–no-verbose]<br>        [-r|–no-recurse-limit]<br>        [-R|–recurse-limit]<br>        [-s format|–format&#x3D;format]<br>        [–help]  [–version]  [symbol…]</p>
<p>C++ 和 Java 语言提供了函数重载的功能，这意味着你可以编写许多具有相同名称的函数，只要每个函数的参数类型不同即可。为了能够区分这些同名的函数，C++ 和 Java 将它们编码为低级汇编名称，这些名称唯一标识每个不同的版本。这一过程称为“符号重整”。c++filt 程序进行相反的映射：它将低级名称解码（去除重整），使其成为用户级别的名称，以便于阅读。</p>
<p>输入中的每个字母数字单词（由字母、数字、下划线、美元符号或句点组成）都是一个潜在的重整名称。如果名称解码为 C++ 名称，那么 C++ 名称将替换输出中的低级名称，否则输出原始单词。通过这种方式，你可以将包含重整名称的整个汇编源文件传递给 c++filt，并看到包含解码名称的相同源文件。</p>
<p>你还可以通过命令行传递符号来使用 c++filt 解码单个符号:<code>c++filt symbol</code></p>
<p>如果未提供符号参数，则 c++filt 从标准输入读取符号名称。所有结果都会打印在标准输出上。从命令行读取名称与从标准输入读取名称的区别在于，命令行参数预期只是重整名称，不会进行检查以将它们与周围文本分开。例如：<code>c++filt -n _Z1fv</code>，将正确解码名称为 f()，而：<code>c++filt -n _Z1fv,</code>,将无法工作。（注意，重整名称末尾的额外逗号使其无效）。然而，以下命令是有效的：<code>echo _Z1fv, | c++filt -n</code><br>并将显示 <code>f(),</code>，即解码后的名称后跟一个尾随逗号。这种行为是因为当从标准输入读取名称时，假设它们可能是汇编源文件的一部分，其中可能包含在重整名称后面的额外字符。例如：<br><code>.type   _Z1fv, @function</code></p>
<p>选项：</p>
<h5 id="x2F-–strip-underscore"><a href="#x2F-–strip-underscore" class="headerlink" title="-_ &#x2F; –strip-underscore"></a>-_ &#x2F; –strip-underscore</h5><p>在某些系统上，C 和 C++ 编译器会在每个名称前加一个下划线。例如，C 名称 foo 得到低级名称 _foo。此选项删除初始下划线。c++filt 是否默认删除下划线取决于目标。</p>
<h5 id="n-x2F-–no-strip-underscore"><a href="#n-x2F-–no-strip-underscore" class="headerlink" title="-n &#x2F; –no-strip-underscore"></a>-n &#x2F; –no-strip-underscore</h5><p>不要删除初始下划线。</p>
<h5 id="p-–no-params"><a href="#p-–no-params" class="headerlink" title="-p –no-params"></a>-p –no-params</h5><p>在解码函数名称时，不显示函数参数的类型。</p>
<h5 id="t-–types"><a href="#t-–types" class="headerlink" title="-t –types"></a>-t –types</h5><p>尝试解码类型和函数名称。默认情况下此选项被禁用，因为重整类型通常仅在编译器内部使用，并且它们可能与未重整的名称混淆。例如，一个名为 a 的函数被视为重整类型名称时，会解码为 signed char。</p>
<h5 id="i-–no-verbose"><a href="#i-–no-verbose" class="headerlink" title="-i –no-verbose"></a>-i –no-verbose</h5><p>不要在解码输出中包含实现细节（如果有）。</p>
<h5 id="r-x2F-R-x2F-–recurse-limit-x2F-–no-recurse-limit-x2F-–recursion-limit-x2F-–no-recursion-limit"><a href="#r-x2F-R-x2F-–recurse-limit-x2F-–no-recurse-limit-x2F-–recursion-limit-x2F-–no-recursion-limit" class="headerlink" title="-r &#x2F; -R &#x2F; –recurse-limit &#x2F; –no-recurse-limit &#x2F; –recursion-limit &#x2F; –no-recursion-limit"></a>-r &#x2F; -R &#x2F; –recurse-limit &#x2F; –no-recurse-limit &#x2F; –recursion-limit &#x2F; –no-recursion-limit</h5><p>启用或禁用解码字符串时执行的递归量限制。由于名称重整格式允许无限递归级别，可能会创建一些字符串，其解码会耗尽主机机器上的堆栈空间，从而触发内存故障。该限制试图通过将递归限制为2048级嵌套来防止这种情况发生。</p>
<p>默认情况下启用此限制，但在解码非常复杂的名称时，可能需要禁用它。然而请注意，如果禁用递归限制，则可能发生堆栈耗尽，并且任何有关此类事件的错误报告都会被拒绝。</p>
<p>-r 选项是 –no-recurse-limit 选项的同义词。-R 选项是 –recurse-limit 选项的同义词。</p>
<h5 id="s-format-x2F-–format-x3D-format"><a href="#s-format-x2F-–format-x3D-format" class="headerlink" title="-s format &#x2F; –format&#x3D;format"></a>-s format &#x2F; –format&#x3D;format</h5><p>c++filt 可以解码由不同编译器使用的各种重整方法。此选项的参数选择它使用的方法：</p>
<ul>
<li><p>auto：基于可执行文件的自动选择（默认方法）</p>
</li>
<li><p>gnu：GNU C++ 编译器（g++）使用的方法</p>
</li>
<li><p>lucid：Lucid 编译器（lcc）使用的方法</p>
</li>
<li><p>arm：C++ 注释参考手册指定的方法</p>
</li>
<li><p>hp：HP 编译器（aCC）使用的方法</p>
</li>
<li><p>edg：EDG 编译器使用的方法</p>
</li>
<li><p>gnu-v3：GNU C++ 编译器（g++）使用的 V3 ABI 方法</p>
</li>
<li><p>java：GNU Java 编译器（gcj）使用的方法</p>
</li>
<li><p>gnat：GNU Ada 编译器（GNAT）使用的方法</p>
</li>
</ul>
<h5 id="–help"><a href="#–help" class="headerlink" title="–help"></a>–help</h5><p>打印 c++filt 选项的摘要并退出。</p>
<h5 id="–version"><a href="#–version" class="headerlink" title="–version"></a>–version</h5><p>打印 c++filt 的版本号并退出。</p>
<p>警告：c++filt 是一个新的工具，其用户界面的细节可能会在未来版本中发生变化。特别是，将来可能需要一个命令行选项来解码作为命令行参数传递的名称；换句话说，<code>c++filt symbol</code>在未来的版本中可能会变成：<code>c++filt option symbol</code></p>
<h4 id="参考连接："><a href="#参考连接：" class="headerlink" title="参考连接："></a>参考连接：</h4><p>【1】<a target="_blank" rel="noopener" href="https://sourceware.org/binutils/docs-2.42/binutils/c_002b_002bfilt.html">https://sourceware.org/binutils/docs-2.42/binutils/c_002b_002bfilt.html</a></p>

    </div>

    
    
    

    <footer class="post-footer">
          

<div class="post-copyright">
<ul>
  <li class="post-copyright-author">
      <strong>本文作者： </strong>feng xun
  </li>
  <li class="post-copyright-link">
      <strong>本文链接：</strong>
      <a href="http://fengxun2017.github.io/2024/11/27/GUN-binary-utilities-c++filt/" title="GNU binary utilities —— c++filt">http://fengxun2017.github.io/2024/11/27/GUN-binary-utilities-c++filt/</a>
  </li>
  <li class="post-copyright-license">
    <strong>版权声明： </strong>本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh" rel="noopener" target="_blank"><i class="fab fa-fw fa-creative-commons"></i>BY-NC-SA</a> 许可协议。转载请注明出处！
  </li>
</ul>
</div>


        

          <div class="post-nav">
            <div class="post-nav-item">
                <a href="/2024/11/25/GUN-binary-utilities-strip/" rel="prev" title="GNU binary utilities —— strip">
                  <i class="fa fa-chevron-left"></i> GNU binary utilities —— strip
                </a>
            </div>
            <div class="post-nav-item">
                <a href="/2024/12/02/Renesas-CPU_System-Overview/" rel="next" title="Renesas-RH850  CPU System - Overview">
                  Renesas-RH850  CPU System - Overview <i class="fa fa-chevron-right"></i>
                </a>
            </div>
          </div>
    </footer>
  </article>
</div>






</div>
  </main>

  <footer class="footer">
    <div class="footer-inner">


<div class="copyright">
  &copy; 
  <span itemprop="copyrightYear">2025</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">feng xun</span>
</div>
<div class="wordcount">
  <span class="post-meta-item">
    <span class="post-meta-item-icon">
      <i class="fa fa-chart-line"></i>
    </span>
      <span>站点总字数：</span>
    <span title="站点总字数">552k</span>
  </span>
  <span class="post-meta-item">
    <span class="post-meta-item-icon">
      <i class="fa fa-coffee"></i>
    </span>
      <span>站点阅读时长 &asymp;</span>
    <span title="站点阅读时长">11:30</span>
  </span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.js.org/muse/" rel="noopener" target="_blank">NexT.Muse</a> 强力驱动
  </div>

    </div>
  </footer>

  
  <script src="https://cdnjs.cloudflare.com/ajax/libs/animejs/3.2.1/anime.min.js" integrity="sha256-XL2inqUJaslATFnHdJOi9GfQ60on8Wx1C2H8DYiN1xY=" crossorigin="anonymous"></script>
<script src="/js/comments.js"></script><script src="/js/utils.js"></script><script src="/js/motion.js"></script><script src="/js/schemes/muse.js"></script><script src="/js/next-boot.js"></script>

  





  





</body>
</html>
